//
// parser.cpp for 203poisson in /home/morel_t//Rendu/maths/203poisson
// 
// Made by thomas morel
// Login   <morel_t@epitech.net>
// 
// Started on  Tue Mar 20 18:29:59 2012 thomas morel
// Last update Tue Mar 20 20:19:37 2012 florian jousseau
//

#include	<iostream>
#include	"203poisson.hh"
#include	"graph.hh"
#include	"convertTo.hpp"


bool		check_params(int option, int nb)
{
  if (option == 1 && nb != 4)
    {
      std::cerr << "./203poisson 1 <n> <k>" << std::endl;
      return (false);
    }
  else if (option == 2 && nb != 4)
    {
      std::cerr << "./203poisson 2 <n> <p>" << std::endl;
      return (false);
    }
  else if (option == 3 && nb != 3)
    {
      std::cerr << "./203poisson 3 <l>" << std::endl;
      return (false);
    }
  else if (option == 4 && nb != 2)
    {
      std::cerr << "./203poisson 4" << std::endl;
      return (false);
    }
  return (true);
}

void		parser(char **av)
{
  if (toNumber<int>(av[1]) == 1)
    std::cout << combinaison(toNumber<int>(av[2]), toNumber<int>(av[3])) << std::endl;
  else if (toNumber<int>(av[1]) == 2)
    aff_etape2(toNumber<int>(av[2]), toNumber<double>(av[3]), option_2(toNumber<int>(av[2]), toNumber<double>(av[3])));
  else if (toNumber<int>(av[1]) == 3)
    aff_etape3(toNumber<double>(av[2]), option_3(toNumber<double>(av[2])));
  else if (toNumber<int>(av[1]) == 4)
    aff_etape4();
}
